{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Request::instance()->baseUrl()}">
        <input type="hidden" name="id" value="{$vo.id ?? ''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>菜单类型：</label>
            <!--<div class="formControls col-xs-6 col-sm-6">-->
            <!--<input type="text" class="input-text" placeholder="菜单类型" name="pid" value="{$vo.pid ?? ''}"  datatype="*" nullmsg="请填写菜单类型(如果是一级菜单:值为0;二级菜单根据类型填写)">-->
            <!--</div>-->

            <div class="formControls col-xs-6 col-sm-6">
                <select name="status" class="select " value="{$vo.pid ?? ''}" datatype="*" nullmsg="菜单类型">
                    <option hidden value="{$vo.pid ?? 0}">
                        {notempty name="vo.pid"}
                        {foreach name='nav_list' item='nav'}
                        {if condition="$nav.id == $vo.pid"} {$nav.title}
                        {/if}
                        {/foreach}
                        {/notempty}
                        {empty name="vo.pid"}
                        默认:一级菜单
                        {/empty}
                    </option>
                    <option value="0">默认:一级菜单</option>
                    {foreach name='nav_list' item='nav' }
                    <option value="{$nav.id}">{$nav.title}</option>
                    {/foreach}
                </select>
            </div>

            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>标题：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="标题" name="title" value="{$vo.title ?? ''}"
                       datatype="*" nullmsg="请填写标题">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>跳转类型：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="jump_type" id="jump_type-1" value="1" datatype="*"
                           nullmsg="跳转类型:1跳转h5;2跳转内部小程序;3:外部小程序;4.有二级菜单">
                    <label for="jump_type-1">跳转h5</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="jump_type" id="jump_type-2" value="2" datatype="*"
                           nullmsg="跳转类型:1跳转h5;2跳转内部小程序;3:外部小程序;4.有二级菜单">
                    <label for="jump_type-2">跳转内部小程序</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="jump_type" id="jump_type-3" value="3" datatype="*"
                           nullmsg="跳转类型:1跳转h5;2跳转内部小程序;3:外部小程序;4.有二级菜单">
                    <label for="jump_type-3">外部小程序</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="jump_type" id="jump_type-4" value="4" datatype="*"
                           nullmsg="跳转类型:1跳转h5;2跳转内部小程序;3:外部小程序;4.有二级菜单">
                    <label for="jump_type-1">有二级菜单</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">跳转的小程序appid：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="跳转的小程序appid" name="appid" value="{$vo.appid ?? ''}">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">跳转h5地址：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" placeholder="跳转h5地址" name="url" value="{$vo.url ?? ''}">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>显示状态：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="status" id="status-0" value="0" datatype="*" nullmsg="显示状态:0显示;1不显示" checked="checked">
                    <label for="status-0">显示</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="status" id="status-1" value="1" datatype="*" nullmsg="显示状态:0显示;1不显示">
                    <label for="status-1">不显示</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>显示权重：取值范围0-8</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="number" class="input-text" placeholder="" name="weight" value="{$vo.weight ?? 0}"
                       datatype="*" nullmsg="显示权重(越大越靠前):取值范围0-8">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='status'][value='{$vo.status ?? ''}']").prop("checked", true);
        $("[name='jump_type'][value='{$vo.jump_type ?? ''}']").prop("checked", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret) {
                ajax_progress(ret);
            }
        });
    })


</script>
{/block}
